home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / misc / gms_sound.lha / Sound / SND_CopyStructure.c < prev    next >
Encoding:
Text File  |  1998-07-19  |  1.2 KB  |  39 lines

  1. /************************************************************************************
  2. ** Action: CopyToUnv()
  3. ** Object: Sound
  4. */
  5.  
  6. LIBFUNC void SND_CopyToUnv(mreg(__a0) LONG argUniverse,
  7.                            mreg(__a1) LONG argSound)
  8. {
  9.   struct Universe *unv = (struct Universe *)argUniverse;
  10.   struct Sound    *snd = (struct Sound *)argSound;
  11.  
  12.   unv->Frequency = snd->Frequency;
  13.   unv->Length    = snd->Length;
  14.   unv->Octave    = snd->Octave;
  15.   unv->Priority  = snd->Priority;
  16.   unv->Source    = snd->Source;
  17.   unv->Volume    = snd->Volume;
  18. }
  19.  
  20. /************************************************************************************
  21. ** Action: CopyFromUnv()
  22. ** Object: Sound
  23. */
  24.  
  25. LIBFUNC void SND_CopyFromUnv(mreg(__a0) LONG argUniverse,
  26.                              mreg(__a1) LONG argSound)
  27. {
  28.   struct Universe *unv = (struct Universe *)argUniverse;
  29.   struct Sound    *snd = (struct Sound *)argSound;
  30.  
  31.   if (!snd->Frequency) snd->Frequency = unv->Frequency;
  32.   if (!snd->Length)    snd->Length    = unv->Length;
  33.   if (!snd->Octave)    snd->Octave    = unv->Octave;
  34.   if (!snd->Priority)  snd->Priority  = unv->Priority;
  35.   if (!snd->Source)    snd->Source    = unv->Source;
  36.   if (!snd->Volume)    snd->Volume    = unv->Volume;
  37. }
  38.  
  39.